package com.taomus.mytools.simplec.common;

/**
 * 
 * @author mrc
 *
 */
public enum WordEnum {
	/**
	 * 运算符 300 ~ 399: = 300 MOV 
	 *  == 301  EQ 
	 *  != 302 NE 
	 *  > 303 GT 
	 *  >= 304 GE 
	 *  < 305  LT 
	 *  <= 306 LE 
	 *  + 307 ADD 
	 *  - 308 SUB * 309 MUL / 310 DIV % 311 MOD += 312 -=
	 * 313 *= 314 /= 315 %= 316 & 317 | 318 ^ 319 ~ 320 >> 321 << 322 &= 323 |=
	 * 324 ^= 325 ~= 326 >>= 327 <<= 328 && 329 || 330 ! 331 and 332 or 333 not
	 * 334 =~ 340 !~ 341 
	 * { 397 } 398 @ 399 关键字 400 ~ 499: func 400 if 401 for 402 while 403
	 * do 404 goto 405 数据类型关键字: int 410 char 412 double 413 String 414 array 415
	 */
	/**
	 * 符号常量 256 ~ 299: 符号 256 ID 数组常量 257 Number 字符常量 258 Char 字符串常量 259 String
	 */
	ID(256,"id"),NUMBER(256,"number"),DECIMAL(257,"decimal"),CHAR(258,"char"),STRING(259,"string"),
	LOCAL(260,"local"),LABEL(298,"label"),TEMP(297,"temp"),NS(299,"ns"),
	MOV(300,"="),
	EQ(301,"=="),NE(302,"!="),GT(303,">"),GE(304,">="),
	LT(305,"<"),LE(306,"<="),AND(307,"and"),OR(308,"or"),NOT(309,"not"),
	ADD(320,"+"),SUB(321,"-"),MUL(322,"*"),DIV(323,"/"),
	MOD(324,"%"),MADD(325,"+="),MSUB(326,"-="),MMUL(327,"*="),MDIV(328,"/="),
	MMOD(329,"%="),
	SPLIT(340,","),
	FUNC(392,"function"),FCALL(393,"FCALL"),FUNCL(394,"{"),FUNCR(395,"}"),
	FRAGRS(396,"Real Argument"),
	FAGRSNUM(397,"function args number"), FAGRS(398,"@"),
	FRET(399,"return"),
	EOF(-1,"EOF"),ERR(-2,"ERROR"),
	//数据类型
	_BOOL(410,"bool"),_CHAR(411,"char"),_INT16(412,"int16"),_INT(413,"int")
	,_INT32(414,"int32"),_INT64(413,"int64"),_FLOAT(417,"float"),_DOUBLE(418,"DOUBLE"),
	_STRING(419,"string"),
	//终结符
	IF(401,"?"),IFELSE(402,"!"),IFEND(403,"?."),IFGT(404,"?>"),IFLT(405,"?<"),IFGE(406,"?>="),
	IFLE(407,"?<="),IFEQ(408,"?=="),IFNE(409,"?!="),
	GOTO(410,"goto"),LP(411,"("),RP(412,")"),
	ROW('\n',"\n"),PRINT(409,"print");
	
	
	private int code;
	private String symbol;
	
	private WordEnum(int code,String symbol){
		this.code = code;
		this.symbol = symbol;
	}
	public int getCode(){
		return this.code;
	}
	public String getSymbol(){
		return this.symbol;
	}
}
